package cn.yeziji.forum.dto.details;

import cn.yeziji.forum.common.Paging;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;

/**
 * 文章分页入参
 *
 * @author gzkemays
 * @since 2021/12/23 23:19
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ForumDetailPagingDTO extends Paging {
  String username;

  @NotBlank(message = "目标不能为空")
  String nickname;

  String title;
  String tags;
  Integer mode;
  Boolean tempSave;
  Boolean delete;
  Boolean collection;
  Boolean good;

  public Integer getMode() {
    return mode == null ? 0 : mode;
  }

  public String getTags() {
    return tags == null ? "" : tags.trim().toLowerCase();
  }
}
